<h2> Editing question <%= @question.id %></h2>
<%= error_messages_for 'question' %>
<div id=edit_question>
  <% form_for :question, :url => question_path(@question), :html => {:method => 'put'} do |f| %>
    <p> Wording: <%= f.text_field :wording %>                    </p>
    <p> Type: <%= f.select :kind, @question_types %>             </p>
    <p> Recommended maximum time: <%= text_field_tag 'question[minutes]',  @minutes %> minutes <%= text_field_tag 'question[seconds]' , @seconds %> seconds </p>
    <div id="answers">
      <%= render :partial => 'answer', :collection => @question.answers.sort {|a, b| a.order <=> b.order} %>
    </div>
    <p> <%= add_answer_field_link "Add answer" %> </p>
    <%= tree_multiple_select(:question, :category_ids, @root_categories, :id, :name)%>
    <p> <%= submit_tag "Update question" %>                      </p>
  <% end %>
</div>